<?php
namespace App\Models;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\Model;
class Dangerous extends  Model{

    public function dangerous_list($id,$page,$pagesize){
		$rs = DB::table('dangerous')
		->leftjoin('dangerous_alias','dangerous.dangerous_id','=','dangerous_alias.dangerous_id')
		->select('dangerous.*','dangerous_alias.alias')
		->groupBy('dangerous.id')
		->orderBy($id,'desc')->offset(($page-1)*$pagesize)->limit($pagesize)->get();
		return $rs;
    }
    public function count_dangerous(){
    	return DB::table("dangerous")->count();
    }
}
?>